#include<bits/stdc++.h>
using namespace std;
int arr[101];
int main()
{
	int n;
	while (cin >> n) {
		int sum = 0;
		for (int i = 0; i < n; i++) {
			cin >> arr[i];
		}
		sort(arr, arr + n);

		for (int i = 0 + 1; i < n - 1; i++) {
			sum += arr[i];
		}
		cout << fixed << setprecision(2) << sum*1.0 / (n - 2) << endl;
	}
	return 0;
}
